package com.nhim.cms.admin.client;

import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;

public enum MenuCategory {
	SYSTEM_ADMINISTRATION("System Administration") {
	    public String toString() {
	        return "System Administration";
	    }
	},

	GLOBAL_SETTINGS("Global Settings") {
	    public String toString() {
	        return "Global Settings";
	    }
	},
	TEMPLATE("Templates") {
	    public String toString() {
	        return "Templates";
	    }
	};
	private static final Map<String, MenuCategory> lookup = new HashMap<String, MenuCategory>();

	static {
		for (MenuCategory s : EnumSet.allOf(MenuCategory.class))
			lookup.put(s.getCode(), s);
	}

	private String code;

	private MenuCategory(String code) {
		this.code = code;
	}

	public String getCode() {
		return code;
	}

	public static MenuCategory get(String code) {
		return lookup.get(code);
	}
	
}
